<?php
if(file_exists(R_P."data/bbscache/hits.txt")){
	$hitarray=explode("|",readover(R_P."data/bbscache/hits.txt"));
	$hits=array_count_values($hitarray);
	foreach($hits as $key=>$value){
		if($key){
			$db->update("UPDATE pw_threads SET hits=hits+'$value' WHERE tid='$key'");
		}
	}
	@unlink(R_P."data/bbscache/hits.txt");
	$nowtime=($timestamp-$tdtime)/3600;
	$hit_control=floor($nowtime/$db_hithour)+1;
	if($hit_control>24/$db_hithour)$hit_control=1;
	$db->update("UPDATE pw_bbsinfo SET hit_control='$hit_control',hit_tdtime='$tdtime' WHERE id=1");
}
?>